package com.bah.tract.client;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.grapher.GrapherModule;
import com.google.inject.grapher.InjectorGrapher;
import com.google.inject.grapher.graphviz.GraphvizModule;
import com.google.inject.grapher.graphviz.GraphvizRenderer;

public class ObjectGrapher {

	public static void main(String[] args) throws IOException {
		PrintWriter out = new PrintWriter(new File("out.dot"), "UTF-8");
		Injector clientInjector = Guice.createInjector(new ClientModule());
		Injector injector = Guice.createInjector(new GrapherModule(),
				new GraphvizModule());
		GraphvizRenderer renderer = injector
				.getInstance(GraphvizRenderer.class);
		renderer.setOut(out).setRankdir("TB");
		injector.getInstance(InjectorGrapher.class).of(clientInjector).graph();
	}

}
